Example: Create test cases in the Batch Processor

Example: Create test cases in the Batch Processor

The Batch Processor can be used to generate test cases, that can be attached to a rulebase project. The input data can be from either .csv files or from a database and can be used to generate an individual test case.

 

Before you start, unzip the InsuranceFraudScore rulebase project that is found at:

examples\rulebases\source\InsuranceFraudScore.zip

Run the Batch Processor

  1. Open a command prompt and go to the examples/determinations-batch/InsuranceFraudScore.
  2. From the command line execute the Batch Processor - this is slightly different for Java or .NET.

    JAVA
    java -jar ../../../engine/determinations-batch.jar --config fraud_score_testcases_config.xml

    .NET
    ..\..\..\engine\Determinations.Batch.exe --config fraud_score_testcases_config.xml

    The Batch Processor will run, executing across the data files in the csv directory. It will write the results to a test_cases.tsc file.

Import the Test Case into the InsuranceFraudScore rulebase

  1. Start Oracle Policy Modeling.
  2. Open the InsuranceFraudScore rulebase; the Oracle Policy Modeling project file will be in the rulebase project that was unzipped and will be in Development\InsuranceFraudScore.xprj.
  3. From the File menu choose Add --> Add Existing File.



  4. Choose the batch_test_cases.tsc file generated from the batch run; the test cases should be added to the Policy Modeling Project.

Examine the test cases

Double-click on the batch_test_cases.tsc test file to open the test cases; you may be prompted to recompile the project before the test cases file is opened.

You should see 10 test cases that have been created from the ten records in the csv files when the batch processor was run.

Once the test cases have been imported into Policy Modeling you can add outcomes and expected values for each case; this will allow you to use the test cases to check the future impact of any rule changes.

For more information on using test cases, see the Oracle Policy Modeling Help topic Create test scripts from existing data.


Look at the configuration

The configuration file used to generate the test cases for this example is almost identical to the configuration file used for the basic InsuranceFraudScore example. The only difference is the change of output from csv to test cases which is done by changing a single line.

The following line, specifies the output as test cases which will be written to the batch_test_cases.tsc file:

<output type="exporttsc">batch_test_cases.tsc</output>